package com.hhl.controller;

import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TestController {

	@RequestMapping(value = "/sessionInfo", method = RequestMethod.GET)
	public Map<String, String> addSession(HttpServletRequest request) {
		String sessionId = request.getSession().getId();
		String requestURI = request.getRequestURI();

		Map<String, String> sessionInfoMap = new HashMap<>(2);
		sessionInfoMap.put("sessionId", sessionId);//3c28c567-e8af-4082-be94-16a821394cd5
		sessionInfoMap.put("requestURI", requestURI);
		return sessionInfoMap;
	}
	
}
